<template>
  <div class="home">
    <el-container style="height: 500px; border: 1px solid #eee">
      <el-aside width="200px" style="background:#334358">
        <el-menu :default-openeds="['1', '3']">
          <el-submenu index="0">
            <template slot="title">
              <i class="el-icon-menu"></i>首页
            </template>
          </el-submenu>
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-document-remove"></i>数据管理
            </template>
            <el-menu-item index="1-1" @click="userlist">用户列表</el-menu-item>
            <el-menu-item index="1-2" @click="shoplist">商家列表</el-menu-item>
            <el-menu-item index="1-3">食品列表</el-menu-item>
            <el-menu-item index="1-4">订单列表</el-menu-item>
            <el-menu-item index="1-5">管理员列表</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-folder-add"></i>添加数据
            </template>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-star-on"></i>图表
            </template>
          </el-submenu>
           <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-edit"></i>编辑
            </template>
          </el-submenu>
           <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-s-tools"></i>设置
            </template>
          </el-submenu>
           <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-warning"></i>说明
            </template>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: left; font-size: 12px">
           <!-- <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>查看</el-dropdown-item>
              <el-dropdown-item>新增</el-dropdown-item>
              <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown> -->
          <!-- <span>王小虎</span>  -->

          首页  /   数据展示   /  
          <span v-show="isShow">商家列表</span>
          <span v-show="!isShow">用户列表</span>
        </el-header>

        <el-main>
          <!-- <el-table :data="tableData">
            <el-table-column prop="date" label="日期" width="140"></el-table-column>
            <el-table-column prop="name" label="姓名" width="120"></el-table-column>
            <el-table-column prop="address" label="地址"></el-table-column>
          </el-table> -->
          <Userlist v-show="!isShow"></Userlist>
          <Shoplist v-show="isShow"></Shoplist>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Userlist from "../components/Userlist";
import Shoplist from "../components/Shoplist";
export default {
  components:{
    Shoplist,Userlist
  },
  data() {
    const item = {
      date: "2016-05-02",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1518 弄"
    };
    return {
      tableData: Array(20).fill(item),
      isShow:true
    };
  },
  methods:{
    userlist(){
      this.isShow=false
    },
     shoplist(){
      this.isShow=true
    }
  }
};
</script>
<style>
.el-header {
  background-color: #ced5df;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;

}
</style>
